#!/usr/bin/env node
const http = require('http'),
      fs   = require('fs'),
      log  =console.log;
const server = http.createServer();
server.listen(8080);
server.on('reauest',(req,res)=>{
  log(`${req.method} ${req.url} HTTP/${req.httpVersion}`);
  log(req.headers);
  log();
  const file= __dirname + req.url;
  res.end(fs.readFileSync(flie).toString(file).toString('utf8'));

});

